package org.asociacion.backend.persistence.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.asociacion.backend.bo.EnumSex;

@Entity
@Table(name="tbl_user", schema="asociacion")
public class TblUser {

	@Id
	@Column(name="id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	@Column(name="first_name", nullable=false, length=100)
	private String firstName;
	
	@Column(name="last_name", nullable=false, length=100)
	private String lastName;
	
	@Column(name="nick_name", nullable=false, length=100, unique=true)
	private String nickName;
	
	@Column(name="email", nullable=false, length=100)
	private String email;
	
	@Column(name="url_image", nullable=false, length=100)
	private String urlImage;
	
	@Column(name="password", nullable=false, length=100)
	private String password;
	
	@Column(name="status", nullable=false)
	private Boolean status;
	
	@Column(nullable=false)
	@Temporal(TemporalType.DATE)
	private Date created;
	
	@Column(name="last_movement", nullable=false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date lastMovement;
	
	@Column(name="current_sex", nullable=false)
	@Enumerated(EnumType.STRING)
	private EnumSex sex;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="tbl_city_id")
	private TblCity tblCity;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getUrlImage() {
		return urlImage;
	}

	public void setUrlImage(String urlImage) {
		this.urlImage = urlImage;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getLastMovement() {
		return lastMovement;
	}

	public void setLastMovement(Date lastMovement) {
		this.lastMovement = lastMovement;
	}

	public EnumSex getSex() {
		return sex;
	}

	public void setSex(EnumSex sex) {
		this.sex = sex;
	}

	public TblCity getTblCity() {
		return tblCity;
	}

	public void setTblCity(TblCity tblCity) {
		this.tblCity = tblCity;
	}
	
}
